//
//  HNSH_ExchangeNetServer.m
//  HNSH_SingleProject
//
//  Created by 李宇廷 on 2023/4/4.
//

#import "HNSH_ExchangeNetServer.h"
#import "HNSH_NetConst.h"

@implementation HNSH_ExchangeNetServer

#pragma mark 积分好礼
// 签到数据
+ (NSURLSessionTask *)requestJFHLMainConfigWithKey:(NSString *)key success:(ST_DataRequestSuccess)success Failure:(ST_RequestFailure)failure {
    NSString *urlString = [NSString stringWithFormat:@"%@?key=%@",URL_JFHL_Main_Config,key];
    return [ST_BaseNetManager requestMethod:HttpMethodGet urlString:urlString params:@{} from:NO success:success failure:failure];
}

/** 兑换产品价格配置
 类型 充值话费  */
+ (NSURLSessionTask *)requestExchangeProductPhoneConfigSuccess:(ST_DataRequestSuccess)success Failure:(ST_RequestFailure)failure {
    NSString *urlString = [NSString stringWithFormat:@"%@",URL_Exchange_Product_Phone_Config];
    return [ST_BaseNetManager requestMethod:HttpMethodGet urlString:urlString params:@{} from:NO success:success failure:failure];
}

/** 兑换产品价格配置
 类型 充值油卡 */
+ (NSURLSessionTask *)requestExchangeProductYouKaConfigSuccess:(ST_DataRequestSuccess)success Failure:(ST_RequestFailure)failure {
    NSString *urlString = [NSString stringWithFormat:@"%@",URL_Exchange_Product_YouKa_Config];
    return [ST_BaseNetManager requestMethod:HttpMethodGet urlString:urlString params:@{} from:NO success:success failure:failure];
}


/** 兑换产品提交
 type
 1是话费 2是油卡*/
+ (NSURLSessionTask *)requestExchangeProductSubmitWithInfo:(NSDictionary *)info success:(ST_DataRequestSuccess)success Failure:(ST_RequestFailure)failure {
    NSString *urlString = [NSString stringWithFormat:@"%@",URL_Exchange_Product_Submit];
    return [ST_BaseNetManager requestMethod:HttpMethodPost urlString:urlString params:info from:NO success:success failure:failure];
}


// 兑换产品记录
+ (NSURLSessionTask *)requestExchangeProductOrderListWithPage:(NSInteger)pageNum success:(ST_DataRequestSuccess)success Failure:(ST_RequestFailure)failure {
    NSString *urlString = [NSString stringWithFormat:@"%@?pageNum=%ld&pageSize=10",URL_Exchange_Product_Order_List,pageNum];
    return [ST_BaseNetManager requestMethod:HttpMethodGet urlString:urlString params:@{} from:NO success:success failure:failure];
}


#pragma mark 任务中心
// 任务中心
+ (NSURLSessionTask *)requestQuestHomeDataSuccess:(ST_DataRequestSuccess)success Failure:(ST_RequestFailure)failure {
    return [ST_BaseNetManager requestMethod:HttpMethodGet urlString:URL_Quest_Home_Data params:@{} from:NO success:success failure:failure];
}

// 任务列表
+ (NSURLSessionTask *)requestQuestConfigsSuccess:(ST_DataRequestSuccess)success Failure:(ST_RequestFailure)failure {
    return [ST_BaseNetManager requestMethod:HttpMethodGet urlString:URL_Quest_Configs params:@{} from:NO success:success failure:failure];
}


//任务兑换
+ (NSURLSessionTask *)requestQuestReceiveWithQuestId:(NSString *)questId type:(NSInteger)type quantity:(NSString *)quantity pay_password:(NSString *)pay_password success:(ST_DataRequestSuccess)success Failure:(ST_RequestFailure)failure {
    NSDictionary * params =  @{@"id":questId,
                               @"quantity":quantity,
                               @"pay_password":pay_password,
                               @"type":@(type)};
    return [ST_BaseNetManager requestMethod:HttpMethodPost urlString:URL_Quest_Receive params:params from:NO success:success failure:failure];
}

// 我的任务
//查询类型 1:我的任务 2:历史任务
+ (NSURLSessionTask *)requestQuestReceiveListWithPage:(NSInteger)pageNum type:(NSInteger)type success:(ST_DataRequestSuccess)success Failure:(ST_RequestFailure)failure {
    NSString *urlString = [NSString stringWithFormat:@"%@?pageNum=%ld&pageSize=10&type=%ld",URL_Quest_Receive_List,pageNum,type];
    return [ST_BaseNetManager requestMethod:HttpMethodGet urlString:urlString params:@{} from:NO success:success failure:failure];
}

//任务兑换
+ (NSURLSessionTask *)requestQuestProgressWithKey:(NSString *)key success:(ST_DataRequestSuccess)success Failure:(ST_RequestFailure)failure {
    NSDictionary * params =  @{@"event_id":[NSString getNowTimeTimestamp]};
    return [ST_BaseNetManager requestMethod:HttpMethodPost urlString:URL_Quest_Progress params:params from:NO success:success failure:failure];
}


// 通证信息
+ (NSURLSessionTask *)requestCapitalHdcDataInfoSuccess:(ST_DataRequestSuccess)success Failure:(ST_RequestFailure)failure {
    return [ST_BaseNetManager requestMethod:HttpMethodGet urlString:URL_Capital_Hdc_Data_Info params:@{} from:NO success:success failure:failure];
}


// 通证兑现配置
+ (NSURLSessionTask *)requestCapitalHdcSwapConfigSuccess:(ST_DataRequestSuccess)success Failure:(ST_RequestFailure)failure {
    return [ST_BaseNetManager requestMethod:HttpMethodGet urlString:URL_Capital_Hdc_Swap_Config params:@{} from:NO success:success failure:failure];
}

//通证兑现申请
+ (NSURLSessionTask *)requestCapitalHdcSwapApplyWithAmount:(NSString *)amount sms_code:(NSString *)sms_code type:(NSInteger)type success:(ST_DataRequestSuccess)success Failure:(ST_RequestFailure)failure {
    NSDictionary * params =  @{@"amount":amount,
                               @"sms_code":sms_code,
                               @"type":@(type)
    };
    return [ST_BaseNetManager requestMethod:HttpMethodPost urlString:URL_Capital_Hdc_Swap_Apply params:params from:NO success:success failure:failure];
}

//通证计算
+ (NSURLSessionTask *)requestCapitalHdcSwapCalculationWithAmount:(NSString *)amount type:(NSInteger)type success:(ST_DataRequestSuccess)success Failure:(ST_RequestFailure)failure {
    NSDictionary * params =  @{@"amount":amount,
                               @"type":@(type)
    };
    return [ST_BaseNetManager requestMethod:HttpMethodPost urlString:URL_Capital_Hdc_Swap_Calculation params:params from:NO success:success failure:failure];
}

@end
